<?php
include_once("../db_connect.php");


$color = mysql_real_escape_string(htmlentities(trim($_GET['color'])));
$brand = mysql_real_escape_string(htmlentities(trim($_GET['brand'])));
$model =mysql_real_escape_string(htmlentities(trim($_GET['model'])));

$sql = mysql_query("SELECT * FROM tblswaping where brand='".$brand."' and model='".$model."' and color='".$color."' ");
if(mysql_num_rows($sql) < 1){
	echo '<div style="padding:10px;"><h3 style="color:white;" >No Item Found</h3></div>';
	die();

}
else{
$display = "";
 
	while($row = mysql_fetch_array($sql)){
	$imgdata = $row['filename'];
	$imgarr	= explode("+",$imgdata); 
	
	$display .= '<li style="opacity: 1;" class="selected">
			<a class="thumb" href="#" title="'. $row['name'].'">
				<img width="300" height="230" src="images/vehicles/'.$imgarr[0].'" alt="">
			</a>
			<a href="preview.php?from=car&pageid='.$row['id'].'" style="color:red">
				View More
			</a>
			
		</li>';
	
	}

}



?>
<!--for the preview of color-->
<link rel="stylesheet" href="css/galleriffic-2.css" type="text/css">
<script type="text/javascript" src="js/jquery.galleriffic.js"></script>
<script type="text/javascript" src="js/jquery.opacityrollover.js"></script>

<script type="text/javascript">
	jQuery(document).ready(function($) {
		// We only want these styles applied when javascript is enabled
		$('div.navigation').css({'width' : '970px', 'float' : 'left'});
		$('div.content2').css('display', 'block');

		// Initially set opacity on thumbs and add
		// additional styling for hover effect on thumbs
		var onMouseOutOpacity = 0.67;
		$('#thumbs ul.thumbs li').opacityrollover({
			mouseOutOpacity:   onMouseOutOpacity,
			mouseOverOpacity:  1.0,
			fadeSpeed:         'fast',
			exemptionSelector: '.selected'
		});
		
		// Initialize Advanced Galleriffic Gallery
		var gallery = $('#thumbs').galleriffic({
			delay:                     2500,
			numThumbs:                 1,
			preloadAhead:              10,
			enableTopPager:            true,
			enableBottomPager:         true,
			maxPagesToShow:            7,
			imageContainerSel:         '#slideshow',
			controlsContainerSel:      '#controls',
			captionContainerSel:       '#caption',
			loadingContainerSel:       '#loading',
			renderSSControls:          true,
			renderNavControls:         true,
			playLinkText:              'Play Slideshow',
			pauseLinkText:             'Pause Slideshow',
			prevLinkText:              '&lsaquo; Previous Photo',
			nextLinkText:              'Next Photo &rsaquo;',
			nextPageLinkText:          'Next &rsaquo;',
			prevPageLinkText:          '&lsaquo; Prev',
			enableHistory:             false,
			autoStart:                 false,
			syncTransitions:           true,
			defaultTransitionDuration: 900,
			onSlideChange:             function(prevIndex, nextIndex) {
				// 'this' refers to the gallery, which is an extension of $('#thumbs')
				this.find('ul.thumbs').children()
					.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
					.eq(nextIndex).fadeTo('fast', 1.0);
			},
			onPageTransitionOut:       function(callback) {
				this.fadeTo('fast', 0.0, callback);
			},
			onPageTransitionIn:        function() {
				this.fadeTo('fast', 1.0);
			}
		});
	});
</script>

<div id="thumbs" class="navigation" style="width: 300px; float: left; opacity: 1;"><div class="top pagination"><span class="current">1</span><a rel="history" href="http://www.twospy.com/galleriffic/example-2.html#16" title="2">2</a><a rel="history" href="http://www.twospy.com/galleriffic/example-2.html#16" title="Next ›">Next ›</a></div>
	<ul class="thumbs">
		<?php echo $display;?>

	</ul>

</div>
